package cn.ronghuanet.basic.listener;

import cn.ronghuanet.auth.service.IPermissionScanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.WebApplicationContext;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.annotation.WebListener;

@WebListener
public class PermissionListener extends ContextLoaderListener {
    @Autowired
    private IPermissionScanService permissionScanService;
    @Override
    public void contextInitialized(ServletContextEvent event) {
        System.out.println("监听器工作...............................");
        // 扫描
        permissionScanService.scan();
        System.out.println("监听器结束...............................");
    }
}
